package com.seckill.Common;

public class BaseResponse {
    private int code;
    private String message;
    private Object data;

    public BaseResponse() {
    }

    public BaseResponse(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static BaseResponse success(){
        return new BaseResponse(200,"调用成功",null);
    }
    public static BaseResponse success(String msg,Object data){
        return new BaseResponse(200,msg,data);
    }
    public static BaseResponse success(String msg){
        return new BaseResponse(200,msg,null);
    }
    public static BaseResponse success(Object data){
        return new BaseResponse(200,"成功",data);
    }

    public static BaseResponse fail(int code,String msg,Object data){
        return new BaseResponse(code,msg,data);
    }
    public static BaseResponse fail(int code,Object data){
        return new BaseResponse(code,"调用失败",data);
    }
    public static BaseResponse fail(int code,String msg){
        return new BaseResponse(code,msg,null);
    }
}
